<form action="index.php?top=page&option=com_frinformation" method="post" name="adminForm" id="adminForm" class="adminform">
<!-- LEFT -->
 <?php echo $this->loadTemplate('search','default') ?>
 <!-- END LEFT -->
 
 <!-- CONTENT -->
 <div id="jm-content">   
    <div class="">
         <h3 class="jm-title" style="position: relative;">
                <label class="jm_name">インフォメーション</label>
         <span style="float: right;position:absolute;right:5px;top:1px;">
                <button href="index.php?top=page&option=com_frinformation">一覧戻る</button>
                </span>
         </h3>
        <div class="info-basic">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tb_main">
                <tbody>
                    <tr>
                        <td width="130" valign="top" nowrap="">
                            掲示カテゴリー
                        </td>
                        <td width="" valign="top">
                            <?php echo  $this->rows->CAIN_NAME; ?>
                        </td>
                    </tr>
                    <tr>
                        <td>件名</td>
                        <td><?php echo $this->rows->INFO_TITLE;?></td>
                    </tr>
                    <tr>
                        <td valign="top">インフォメーション本文</td>
                        <td style="text-align: justify;">
                            <textarea cols="70" rows="10" readonly="true" ><?php echo $this->rows->INFO_BODY;?></textarea>
                            </td>
                        
                    </tr>
                    <!--
                    <tr>
                        <td valign="top">宛先</td>
                        <td>
                            <table style="width: 100%;" border=1 id="tb_blue">
                            
                                <tr>
                                    <th>No.</th>
                                    <th>名前</th>
                                    <th>ユーザ名</th>
                                    <th>Email</th>
                                </tr>
                                <?php
                                if($this->users != null){
                                    $i=1;
                                    foreach($this->users as $k=>$user){ 
                                        //echo "<pre>";
//                                        print_r($user);
//                                        echo "</pre>";
                                ?>
                                <tr>
                                    <td class="number"><?php echo $i;$i++; ?></td>
                                    <td><?php echo $user->name; ?></td>
                                    <td><?php echo $user->username ;?></td>
                                    <td><?php echo $user->email ;?></td>
                                </tr>
                                <?php
                                            }
                                    }else{
                                    ?>
                                        <tr>
                                            <td class="center" colspan="5">データは見つかりませんでした</td>
                                        </tr>
                                    <?php    
                                    }
                                 ?>
                            </table>
                        </td> 
                    </tr>
                    -->
                    <?php
                        $file_name = $this->rows->INFO_FILE_1;
                                 
                        $urlFile = urlencode($file_name);
                        $dowi_path  = "download.php?folder=files/com_information&file=".$urlFile;   
                            
                        $encode_filename = sha1($file_name);                
                        $check_file = "uploads/files/com_information/$encode_filename";
                         
                    ?>
                    <tr>
                        <td>添付ファイル1</td>
                        <td>
                            <?php
                            if(file_exists($check_file)){
                               ?>
                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->INFO_FILE_1 ;?></a>
                             <?php 
                             }
                             else
                                echo '<a href="javascript:alertError();">'.$this->rows->INFO_FILE_1.'</a>';
                            ?>
                        </td>
                            
                        
                    </tr>
                    <tr>
                        <td>添付ファイル2</td>
                     <?php
                        $file_name = $this->rows->INFO_FILE_2;
                                 
                        $urlFile = urlencode($file_name);
                        $dowi_path  = "download.php?folder=files/com_information&file=".$urlFile;   
                            
                        $encode_filename = sha1($file_name);                
                        $check_file = "uploads/files/com_information/$encode_filename";
                    ?>
                        <td>
                        <?php
                            if(file_exists($check_file)){
                               ?>
                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->INFO_FILE_2 ;?></a>
                             <?php 
                             }
                             else
                                echo '<a href="javascript:alertError();">'.$this->rows->INFO_FILE_2.'</a>';
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td>添付ファイル3</td>
                    <?php
                        $file_name = $this->rows->INFO_FILE_3;
                                 
                        $urlFile = urlencode($file_name);
                        $dowi_path  = "download.php?folder=files/com_information&file=".$urlFile;   
                            
                        $encode_filename = sha1($file_name);                
                        $check_file = "uploads/files/com_information/$encode_filename"; 
                    ?>
                        <td>
                        <?php
                            if(file_exists($check_file)){
                               ?>
                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->INFO_FILE_3 ;?></a>
                             <?php 
                             }
                             else
                                echo '<a href="javascript:alertError();">'.$this->rows->INFO_FILE_3.'</a>';
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td>添付ファイル4</td>
                     <?php
                        $file_name = $this->rows->INFO_FILE_4;
                                 
                        $urlFile = urlencode($file_name);
                        $dowi_path  = "download.php?folder=files/com_information&file=".$urlFile;   
                            
                        $encode_filename = sha1($file_name);                
                        $check_file = "uploads/files/com_information/$encode_filename"; 
                    ?>
                        <td>
                        <?php
                            if(file_exists($check_file)){
                               ?>
                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->INFO_FILE_4 ;?></a>
                             <?php 
                             }
                             else
                                echo '<a href="javascript:alertError();">'.$this->rows->INFO_FILE_4.'</a>';
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td>添付ファイル5</td>
                     <?php
                        $file_name = $this->rows->INFO_FILE_5;
                                 
                        $urlFile = urlencode($file_name);
                        $dowi_path  = "download.php?folder=files/com_information&file=".$urlFile;   
                            
                        $encode_filename = sha1($file_name);                
                        $check_file = "uploads/files/com_information/$encode_filename"; 
                    ?>
                        <td>
                        <?php
                            if(file_exists($check_file)){
                               ?>
                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->INFO_FILE_5 ;?></a>
                             <?php 
                             }
                             else
                                 echo '<a href="javascript:alertError();">'.$this->rows->INFO_FILE_5.'</a>';
                              ?>
                                
                        </td>
                    </tr>
                    
                </tbody>
                </table>
            
        </div>
             <input type="hidden" name="task" value=""/>
	<input type="hidden" name="boxchecked" value="0" />  
        
    </div>
    
 </div>
 <!-- END CONTENT -->
   </form>       
   
   <script>
    function alertError(){
        /*alert("KHONG TIM THAY FILE");*/
        alert("ファイルが見つかりません。");
    }
</script>
                